'''
Created on Oct 20, 2009

@author: kage
'''

from PyBatch.handlers import base

class VideoExtractor(base.MuxBase):
    def start(self, args=None):
        q='"'
        self.__inputPath = args['inputPath'].replace('\\','/')
        self.__outputPath = args['outputPath'].replace('\\','/')
        self.__video_track = str(args['video_track'])
        self.__title = args['title']
    
        #remuxing command and arguements
        self.__command = q + self.mkvMergePath + q + " -o " + q + self.__outputPath + q
        self.__command += ' "--priority" "' + self.priority + '" "--default-track" "1:yes" "--forced-track" "1:no"'
        self.__command += ' "-A" "-S" "-d" ' + q +self.__video_track + q + ' "-T" "--no-global-tags"'+' '
        self.__command += q + self.__inputPath + q + ' "--track-order" "0:' + self.__video_track
        self.__command += '" "--title" "' + self.__title + '"'
        
        self.setCommandLine(self.__command)
        self.muxOperation()